import Vue from 'vue'
import App from './App'
import router from './router'
import "./assets/css/global.css"
import axios from 'axios'
axios.defaults.baseURL = "https://www.liulongbin.top:8888/api/private/v1/"
Vue.prototype.$http = axios;
Vue.config.productionTip = false
// 导入element-ui组件
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
// 路由拦截_font-awesome@4.7.0@font-awesome\css
import "_font-awesome@4.7.0@font-awesome/css/font-awesome.min.css"
router.beforeEach((to, from, next) => {
  if(to.path == '/login') return next()
  const token = sessionStorage.getItem("token")
  if(!token) return next("/login")
  next(); //前往下一个页面
})
Vue.use(ElementUI);
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  render: h => h(App)
})
